package com.vj.analyzeFakeNames;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.util.Date;

import junit.framework.Assert;

import org.junit.Test;

// how to define log print
public class Log {
	
	private String fileEncoding;

	@Test public void test() throws UnsupportedEncodingException, FileNotFoundException{
		String logFile = ""; 
		PrintStream log = new PrintStream(new FileOutputStream(logFile, false), true, fileEncoding);
		String msg = null;
		// or : log = new PrintStream(System.err);
		log.println(new Date() + ": " + msg);
		
		// also can print exception into printStream
		Throwable e = null;
		e.printStackTrace(log);
		
		Assert.assertTrue(false);
	}
	
	

}
